// getters 的另一种玩法: 去映射模块内的数据 做一个快捷访问
// {{ $store.state.app.sidebar }}
// {{ $store.getters.sidebar }}
// 这种快捷访问的优势只有在数据复杂时 体现出来 => 走着瞧!!!
const getters = {
  // sidebar: state => state.app.sidebar,
  sidebar(state) {
    return state.app.sidebar
  },
  device: state => state.app.device,
  // token(state) {
  //   return state.user.token
  // }
  token: state => state.user.token,
  name: state => state.user.userInfo.username,
  staffPhoto: state => state.user.userInfo.staffPhoto,
  routes: state => state.permission.routes,
  roles: state => state.user.userInfo.roles
}
export default getters

// this.$store.state.user.token
// this.$store.getters.token

// const getters = {
// total() {
//   return 30
// }
// total: () => 30
// sidebar: state => state.app.sidebar,
// sidebar(state) {
//   return state.app.sidebar
// }
// }
